﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;

namespace BHair
{
    public partial class frmhypwd : Form
    {
        public frmhypwd()
        {
            InitializeComponent();
        }
        string constr = ConfigurationManager.ConnectionStrings["BHair.Properties.Settings.BHairDBConnectionString"].ConnectionString;
        private void button1_Click(object sender, EventArgs e)
        {
            string pwd = txtpwd.Text;
            string cardID = chuanzhi.cardID;
            SqlConnection conn = new SqlConnection(constr);
            conn.Open();
            string sql =string.Format( "SELECT [mid],[mname],[mpass] FROM [BHairDB].[dbo].[member] where mid='{0}' and mpass='{1}'",cardID,pwd);
            SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
            DataTable dt = new DataTable();
            sda.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                this.Close();
            }
            else
            {
                MessageBox.Show("会员密码错误");
            }
        }
    }
}
